package servlet;

import bean.Text;
import dao.impl.DaoImpl;

import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpSession;

/**
 * 登录后台处理
 * Servlet implementation class LoginServlet
 */
@WebServlet(name = "ShowServlet", value = "/ShowServlet")
public class ShowServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        DaoImpl dao = new DaoImpl();
        List<Text> list = dao.showAll();

        HttpSession session = req.getSession();
        session.setAttribute("list",list);


        req.getRequestDispatcher("show.jsp").forward(req,resp);


    }
}
